package com.sxz.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.sxz.mall.common.validator.ListValue;
import com.sxz.mall.product.exception.groups.AddGroupsInterface;
import com.sxz.mall.product.exception.groups.UpdateGroupsInterface;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * 品牌
 *
 * @author shixinzhi
 * @email 395441300@qq.com
 * @date 2024-08-20 12:15:20
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 品牌id
     */
    @NotNull(message = "更新数据ID不能为空", groups = {UpdateGroupsInterface.class})
    @Null(message = "添加信息ID必须为空", groups = {AddGroupsInterface.class})
    @TableId
    private Long brandId;
    /**
     * 品牌名
     */
    @NotBlank(message = "品牌的名称不能为空")    // 不能为空
    private String name;
    /**
     * 品牌logo地址
     */
    @NotBlank(message = "logo不能为空")
    private String logo;
    /**
     * 介绍
     */
    private String descript;
    /**
     * 显示状态[0-不显示；1-显示]
     */
    @ListValue(val = {0, 1}, groups = {AddGroupsInterface.class})
    private Integer showStatus;
    /**
     * 检索首字母
     */
    @NotBlank(message = "检索首字母不能为空")
    @Pattern(regexp = "/^a-zA-Z/$", message = "必须是字母")
    private String firstLetter;
    /**
     * 排序
     */
    @NotNull(message = "排序不能为null")
    @Min(value = 0, message = "排序不能为负数")
    private Integer sort;

}
